package com.example.zy.car.base;

import android.app.Activity;
import android.os.Bundle;
import android.support.v4.app.FragmentManager;

public abstract class BaseActivity extends Activity {

    public FragmentManager mFragmentManager;
    public BaseActivity mBaseActivity;
//    public List<BaseMyFragment> mBaseMyFragments=new ArrayList<>();
    @Override
    protected void onCreate(Bundle savedInstanceState) {
        super.onCreate(savedInstanceState);
//        mFragmentManager=this.getSupportFragmentManager();
        mBaseActivity=this;
        BaseActivityManager.addActivity(this);

    }
    public void killSelf(){
        this.finish();
    }

    @Override
    protected void onDestroy() {
        super.onDestroy();
        BaseActivityManager.removeActivity(this);
    }

    @Override
    public void onBackPressed() {
//        for(BaseMyFragment fragment:mBaseMyFragments){
//            if(fragment.isVisible()&&fragment.onBackPressed()){
//                return;
//            }
//        }
        super.onBackPressed();
    }
}
